package com.example.springboot_4_knife4j.controller;

import com.example.springboot_4_knife4j.pojo.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@Tag(name = "用户接口实现",description = "完成了用户的CRUD操作")
public class UserController {


    @GetMapping("/getUserById")
    @Operation(summary = "根据id查询用户")
    public User getUserById(@Parameter(description = "用户id号") int id){
        return new User(111,"小李",20,"男",0);
    }

    @PostMapping("/saveUser")
    @Operation(summary = "新增用户")
    public User saveUser(@RequestBody @Parameter(description = "用户信息AAAA") User user){

        return user;
    }
}
